Skip to content

feat(pm-stack): scheduled digest from the canonical projection (#1278) - #5279

Merged
dezren39 merged 4 commits into
mainfrom
queue/4988-1278-pm-digest
Nov 4, 2026
Merged

dezren39 merged 4 commits into
mainfrom
queue/4988-1278-pm-digest

Conversation

@dezren39

@dezren39 dezren39 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Fixes #1278

Scheduled PM digest from the canonical projection — no separate reporting pipeline:

  • src/digest.ts — pure buildDigest over the same inputs the pages render (Project pool, Needs-Drew census, quota view): moved / blocked / needs Drew / done / quota outlook sections, every item linked, header states per-facet freshness, and a missing, stale, or incomplete source marks its section stale with its age instead of silently omitting it. Quota outlook includes wall predictions (burn rate filling a window before its reset). digestText is the chat rendering of the identical structure.
  • Archive — one JSON per digest (PM_AGG_DIGESTS_DIR, state dir in the NixOS wiring); /digest?date=<date> renders the stored digest verbatim, /digest builds live, /api/digest.json is the machine twin, /api/digests.json lists the archive. Page registered in the manifest at dropdown tier (recorded in the dashboard: clean up the page list (12 registered pages, overlaps to resolve) #1497 curation table).
  • Delivery + schedule — scripts/generate-digest.ts archives first, then delivers via Web Push (class digest) through the alert throat's subscriptions with send bookkeeping. systemd + NixOS timers: daily 07:00 local, weekly Mon 07:05 local.

Verification:

  • bun test full aggregator suite: 1523 pass, 0 fail (includes 8 new test/digest.test.ts tests and the manifest/nav governance tests).
  • tsc --noEmit: clean except a pre-existing GhKind error in untouched src/item-history.ts on main.
  • Fixtures smoke on the laptop: /digest, /api/digest.json, /api/digests.json, generator archive write, and the dated archive render all verified live.

Queue: task 4988 · epic #1184


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Daily digest + weekly roll-up built by a pure buildDigest over the same projection the pages render (Project pool, Needs-Drew census, quota view): moved / blocked / needs Drew / done / quota outlook, every item linked, header states per-facet freshness, and a missing/stale/incomplete source marks its section stale with its age instead of omitting it.

Archived as JSON per day (PM_AGG_DIGESTS_DIR) and rendered verbatim at the dated URL /digest?date=<date>; /digest + /api/digest.json build live, /api/digests.json lists the archive. scripts/generate-digest.ts archives first, then delivers to chat via Web Push (class digest) through the alert throat subscriptions. Scheduled by systemd/NixOS timers: daily 07:00 local, weekly Mon 07:05 local.

Tests: test/digest.test.ts (8) + full suite 1523 pass; manifest curation table records digest at dropdown tier.
@dezren39
dezren39 requested a review from a team as a code owner November 4, 2026 04:14
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b5c63d39-0849-4803-9396-c868cc2309a9
Commits

Reviewing files that changed from the base of the PR and between 85c0e0b and cfbb8b8.

Files selected for processing: 17
  • doc/fleet-schedule-registry.md
  • nixos/services/pm-stack/default.nix
  • pm-stack/aggregator/scripts/generate-digest.ts
  • pm-stack/aggregator/src/config.ts
  • pm-stack/aggregator/src/digest.ts
  • pm-stack/aggregator/src/model.ts
  • pm-stack/aggregator/src/pages.ts
  • pm-stack/aggregator/src/projects.ts
  • pm-stack/aggregator/src/render.ts
  • pm-stack/aggregator/src/server.ts
  • pm-stack/aggregator/systemd/digest-daily.service
  • pm-stack/aggregator/systemd/digest-daily.timer
  • pm-stack/aggregator/systemd/digest-weekly.service
  • pm-stack/aggregator/systemd/digest-weekly.timer
  • pm-stack/aggregator/test/curation-1497.test.ts
  • pm-stack/aggregator/test/digest.test.ts
  • pm-stack/systemd/pm-aggregator.service
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T07:18:17.156415Z cfbb8b8 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8dc9f9a3bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread nixos/services/pm-stack/default.nix Resolved
Comment thread pm-stack/aggregator/src/digest.ts Resolved
Comment thread pm-stack/aggregator/src/digest.ts Resolved
P1: register pm-digest-daily/pm-digest-weekly in doc/fleet-schedule-registry.md (root AGENTS.md same-PR rule). P2s: weekly archive routes carry kind=weekly; pool freshness is measured (items() prime + projectsAvailable + live-mode unprimed facet reads stale, never healthy); digest delivery honors classEnabled + quiet hours with suppressed-quiet ledgering; quota forecast states hours-from-now until the fill, not a wall-to-reset interval.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41f82670ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pm-stack/aggregator/src/digest.ts Resolved
Comment thread pm-stack/aggregator/src/digest.ts Resolved
Comment thread pm-stack/aggregator/src/render.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10e9d1e4f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dezren39

dezren39 commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: cfbb8b8d19

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dezren39

dezren39 commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

Codex disposition (task 4988 resume, lane code-m): all 10 findings from the earlier rounds were replied 'Fixed' by the implementing session; I re-verified each against the current head cfbb8b8 before resolving its thread — fleet-registry rows for both timers (doc/fleet-schedule-registry.md:251-252), kind in weekly archive links (digest.ts:319), freshness/provenance before archiving + stale section marking, quiet-hours suppression via inQuietHours (generate-digest.ts:82-86), reset-relative forecast (digest.ts:357-363), provider freshness + completion-time selection (both pinned by passing '(#5279 Codex)' tests), EnvironmentFile in both standalone units, machine-twin identity (render.ts:7163), shared PM_AGG_DIGESTS_DIR. Local verification mirroring the queued CI: bun test 1527/1527 pass (digest 12/12), contract:check passed; typecheck shows only a pre-existing main error in src/item-history.ts (untouched by this PR). Merging under the standing criteria.

@dezren39
dezren39 merged commit 10b3a4b into main Nov 4, 2026
2 of 3 checks passed
@dezren39
dezren39 deleted the queue/4988-1278-pm-digest branch November 4, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(pm-stack): scheduled digest — daily/weekly PM digest from the canonical projection, delivered to chat and archived as a dashboard page

1 participant